package com.heima.article.feign;

import com.heima.article.service.ApArticleService;
import com.heima.feign.article.IArticleClient;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jack
 * @data 2024 15:19
 */
@RestController
public class ArticleClient implements IArticleClient {
    @Autowired
    private ApArticleService apArticleService;

    /**
     * 新增或修改app文章信息
     *
     * @param articleDto
     * @return
     */
    @PostMapping("/api/v1/article/saveOrUpdate")
    public ResponseResult saveArticle(@RequestBody ArticleDto articleDto) {
        return apArticleService.saveOrUpdateArticle(articleDto);
    }
}
